package com.xuliugen.security.web.controller.async;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.concurrent.Future;

/**
 * AsyncRestTemplate 可以使用Spring Cloud
 * Created by xuliugen on 2017/11/5.
 */
@RestController
@RequestMapping(value = "/rest")
public class AsyncRestController {

    //@Autowired
    //private AsyncRestTemplate restTemplate;

    @GetMapping
    public Future<ResponseEntity<String>> getResult() {
        //Future<ResponseEntity<String>> futureEntity = restTemplate.getForEntity(
        //        "http://example.com/hotels/{hotel}/bookings/{booking}", String.class, "42", "21");
        //return futureEntity;
        return null;
    }
}
